﻿<phone:PhoneApplicationPage
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:Coding4Fun_Phone_Controls="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls" xmlns:es="clr-namespace:Microsoft.Expression.Shapes;assembly=Microsoft.Expression.Drawing"
                            xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                            xmlns:Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
                            xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" x:Class="ScheduleMVVM.FavouritesPage"
                            mc:Ignorable="d"
                            d:DesignWidth="480"
                            d:DesignHeight="800"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            toolkit:TiltEffect.IsTiltEnabled="True"
                            >
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="RouteListTemplate">
            <ListBoxItem Height="70" Width="450">
        		<Grid Height="70" Width="450">
        			<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Title}" d:LayoutOverrides="Height" VerticalAlignment="Top" Margin="30,5,0,0" FontSize="26.667">
        				<i:Interaction.Triggers>
        					<i:EventTrigger EventName="Tap">
        						<Command:EventToCommand Command="{Binding RoutePageShowCommand}"/>
        						<ec:NavigateToPageAction TargetPage="/RoutePage.xaml"/>
        					</i:EventTrigger>
        				</i:Interaction.Triggers>
        			</TextBlock>
        			<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding RouteString}" d:LayoutOverrides="Height" Margin="50,0,0,5" VerticalAlignment="Bottom" FontSize="18.667" Style="{StaticResource PhoneTextSubtleStyle}">
        				<TextBlock.Foreground>
        					<SolidColorBrush Color="{StaticResource Mango Leaf Green}"/>
        				</TextBlock.Foreground>
        				<i:Interaction.Triggers>
        					<i:EventTrigger EventName="Tap">
        						<Command:EventToCommand Command="{Binding RoutePageShowCommand}"/>
        						<ec:NavigateToPageAction TargetPage="/RoutePage.xaml"/>
        					</i:EventTrigger>
        				</i:Interaction.Triggers>
        			</TextBlock>
        			<Coding4Fun_Phone_Controls:RoundButton Content="" HorizontalAlignment="Right" VerticalAlignment="Stretch" d:LayoutOverrides="Height" Margin="0,8,-8,-3" ImageSource="/icons/appbar.close.rest.png" RenderTransformOrigin="0.5,0.5">
        				<Coding4Fun_Phone_Controls:RoundButton.Foreground>
        					<SolidColorBrush Color="{StaticResource Mango Leaf Green}"/>
        				</Coding4Fun_Phone_Controls:RoundButton.Foreground>
        				<Coding4Fun_Phone_Controls:RoundButton.BorderBrush>
        					<SolidColorBrush Color="#FF66AA2B"/>
        				</Coding4Fun_Phone_Controls:RoundButton.BorderBrush>
        				<i:Interaction.Triggers>
        					<i:EventTrigger EventName="Click">
        						<Command:EventToCommand Command="{Binding DeleteFavouriteCommand}"/>
        					</i:EventTrigger>
        				</i:Interaction.Triggers>
        				<Coding4Fun_Phone_Controls:RoundButton.RenderTransform>
        					<CompositeTransform ScaleX="0.8" ScaleY="0.8"/>
        				</Coding4Fun_Phone_Controls:RoundButton.RenderTransform>
        			</Coding4Fun_Phone_Controls:RoundButton>
        			<Coding4Fun_Phone_Controls:RoundButton Content="" HorizontalAlignment="Right" VerticalAlignment="Stretch" d:LayoutOverrides="Height" Margin="0,8,46,-3" ImageSource="icons/appbar.pin.rest.png" RenderTransformOrigin="0.5,0.5">
        				<Coding4Fun_Phone_Controls:RoundButton.BorderBrush>
        					<SolidColorBrush Color="{StaticResource Mango Leaf Green}"/>
        				</Coding4Fun_Phone_Controls:RoundButton.BorderBrush>
        				<Coding4Fun_Phone_Controls:RoundButton.Foreground>
        					<SolidColorBrush Color="{StaticResource Mango Leaf Green}"/>
        				</Coding4Fun_Phone_Controls:RoundButton.Foreground>
        				<i:Interaction.Triggers>
        					<i:EventTrigger EventName="Click">
        						<Command:EventToCommand Command="{Binding PinEntryCommand, Mode=OneWay}"/>
        					</i:EventTrigger>
        				</i:Interaction.Triggers>
        				<Coding4Fun_Phone_Controls:RoundButton.RenderTransform>
        					<CompositeTransform ScaleX="0.8" ScaleY="0.8"/>
        				</Coding4Fun_Phone_Controls:RoundButton.RenderTransform>
        			</Coding4Fun_Phone_Controls:RoundButton>
        		</Grid>
        	</ListBoxItem>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>
	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
	<phone:PhoneApplicationPage.DataContext>
		<Binding Path="Favourites" Source="{StaticResource Locator}"/>
	</phone:PhoneApplicationPage.DataContext>
    <!-- Transition support -->
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneBackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel"
                    Grid.Row="0"
                    Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle"
                       Text="{Binding ApplicationTitle}"
                       Style="{StaticResource PhoneTextNormalStyle}" />
            <TextBlock x:Name="PageTitle"
                       Text="{Binding PageTitle}"
                       Margin="9,-7,0,0"
                       Style="{StaticResource PhoneTextTitle1Style}" />
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel"
              Grid.Row="1"
              Margin="12,0,12,0">
        	<ListBox ItemsSource="{Binding Favourites}" ItemTemplate="{StaticResource RouteListTemplate}"/></Grid>
    </Grid>

</phone:PhoneApplicationPage>